﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.XSchEmA.Entity;

namespace Pixysoft.Framework.XSchEmA.Comparer
{
    class DatabaseComparer : IDbComparer
    {
        public IDataTableCompareResult CompareTable(DatabaseSchema aDatabase, DatabaseSchema bDatabase)
        {
            return new DataTableComparer().Compare(aDatabase, bDatabase);
        }

        public IColumnCompareResult CompareColumn(TableSchema aTable, TableSchema bTable)
        {
            return new ColumnComparer().Compare(aTable, bTable);
        }

        public IDataTypeCompareResult CompareDataType(ColumnSchema aColumn, ColumnSchema bColumn)
        {
            return new DataTypeComparer().Compare(aColumn, bColumn);
        }

        public IPrimarykeyCompareResult ComparePrimaryKey(DatabaseSchema aDatabase, DatabaseSchema bDatabase)
        {
            return new PrimarykeyComparer().Compare(aDatabase, bDatabase);
        }

        public IForeignkeyCompareResult CompareForeignKey(DatabaseSchema aDatabase, DatabaseSchema bDatabase)
        {
            return new ForeignkeyComparer().Compare(aDatabase, bDatabase);
        }

        public IUniqueCompareResult CompareUnique(DatabaseSchema aDatabase, DatabaseSchema bDatabase)
        {
            return new UniqueComparer().Compare(aDatabase, bDatabase);
        }
    }
}
